define(function(require){
    $(function(){
    	/*---------- 通用登录 ----------*/
    	
        $('.forget').click(function(){
            require.async('dialog',function($dialog){
                $dialog({
                    title: '找回密码',
                    content: '请联系管理员找回密码：trp@semidata.com'
                }).showModal();
            });
        });

        $("#rememberBox").change(function(){
        	$("#remember").val(this.checked ? "1":"0")
        });

        function initRememberBox(){
    		remember = $.trim($("#remember").val());
    		console.log(remember);
            if(remember=="1"){
            	$("#rememberBox").attr("checked",true)
            }
    	};
    	initRememberBox();
    	
    	/* 修正浏览器自动填充密码后的黄色背景 */
    	setTimeout(function(){
    		try{
    			var arr = [];
    			$('input:-webkit-autofill').each(function(){
    				arr.push({node:$(this), value:$(this).val()});
    			}).parents('form:first')[0].reset();
    			$.each(arr, function(i,n){
    				n.node.val(n.value);
    			});
    		}catch(e){}
    	},500);
    });
});